package com.quick.im.common.thread;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 线程池切面
 *
 * @author XiaoXuxuy
 * @date 2022/2/20 15:35
 */
@Target({METHOD})
@Retention(RUNTIME)
public @interface Pooled {

    boolean async() default true;

    long timeout() default 500;

    String executor() default "ciToolExecutor";

    PoolOverAct poolOverAct() default PoolOverAct.REJECT;

    enum PoolOverAct {
        REJECT, BLOCK, RUN, NEW_THREAD;
    }
}
